<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }

        ul {
            width: 60px;
            margin: 100px auto;
        }

        li {
            width: 60px;
            height: 40px;
            text-align: center;
            line-height: 40px;
            cursor: pointer;
            list-style: none;
        }

        .top:hover {
            background-color: #aaa;
            color: #f40;
        }

        .hide {
            display: none;
            border: 1px solid #e20;
            border-top: 0;
        }

        .hide:hover {
            background-color: #f40;
        }
    </style>
</head>

<body>
    <ul>
        <li class="top">微博</li>
        <li class="hide">私信</li>
        <li class="hide">评论</li>
        <li class="hide">@我</li>
    </ul>
    <script>
        //var top = document.querySelector('.top');
        var hide = document.querySelectorAll('.hide');//获取的是一个伪数组
        var ul = document.querySelector('ul');
        ul.onmouseover = function () {
            hide[0].style.display = 'block';
            hide[1].style.display = 'block';
            hide[2].style.display = 'block';
        }
        ul.onmouseout = function () {
            hide[0].style.display = 'none';
            hide[1].style.display = 'none';
            hide[2].style.display = 'none';
        }
    </script>
</body>

</html>